using System;
using System.Drawing;

namespace WebChart
{
	public class TriangleLineMarker : LineMarker
	{
		// Fields
		private Brush brush;
		private Pen pen;

		// Methods
		public TriangleLineMarker()
		{
			this.brush = null;
			this.pen = null;
		}

		public TriangleLineMarker(int size, Color color, Color borderColor) : base(size, color, borderColor)
		{
			this.brush = null;
			this.pen = null;
		}

		public override void Render(Graphics graphics, int x, int y)
		{
			int num = base.Size / 2;
			Point[] points = new Point[] { new Point(x - num, y + num), new Point(x, y - num), new Point(x + num, y + num) };
			graphics.DrawPolygon(this.Pen, points);
			graphics.FillPolygon(this.Brush, points);
		}

		// Properties
		private Brush Brush
		{
			get
			{
				if (this.brush == null)
				{
					this.brush = new SolidBrush(base.Color);
				}
				return this.brush;
			}
		}

		private Pen Pen
		{
			get
			{
				if (this.pen == null)
				{
					this.pen = new Pen(base.BorderColor, 0f);
				}
				return this.pen;
			}
		}
	}
}
